//
//  BIDDownloadFile.h
//  shangwuting
//
//  Created by mal on 13-12-25.
//  Copyright (c) 2013年 mal. All rights reserved.
//

#import <Foundation/Foundation.h>

@class BIDCustomSpinnerView;

@protocol BIDDownloadFileDelegate <NSObject>

- (void)toOpenDoc;

@end

@interface BIDDownloadFile : NSObject<NSURLConnectionDataDelegate, NSURLConnectionDelegate>

@property (strong, nonatomic) UILabel *label;
@property (strong, nonatomic) UIProgressView *progressView;
@property (strong, nonatomic) UIButton *cancelBtn;
@property (strong, nonatomic) UIView *downloadView;
@property (strong, nonatomic) UIView *bgView;
@property (strong, nonatomic) BIDCustomSpinnerView *spinnerView;
@property (strong, nonatomic)NSURLConnection *urlConnection;
@property (strong, nonatomic)NSMutableData *fileData;
//文件名字
@property (copy, nonatomic) NSString *fileName;
//文件大小
@property (assign, nonatomic) NSUInteger fileLength;
//
@property (strong, nonatomic)id<BIDDownloadFileDelegate> delegate;

//保存文件的位置,library目录下
@property (copy, nonatomic)NSString *saveDirectory;

//取消上传
- (void)cancelBtnHandler;

//
- (void)initData;
//
- (void)initDownloadView;
//
- (void)downloadFile:(NSString*)strDownloadURL;

@end
